class UrlMappings {
	// mappings re
	// root/show/action
	static mappings = {
		"/$controller/$action?/$id?"{
			constraints {
				// apply constraints here
			}
		}
        // M-1: The main landing page shows listings sorted by the date they were created (most recent first)
        "/"(controller:"listing", action:"list")
		// "/"(view:"/index")
		"500"(view:'/error')

        // REST mappings use prefix rest to prevent conflicts with other urls
        "/rest/listing/$id"(controller:"listing", parseRequest:true) {
            action = [GET:"listingDetail"]
        }

        "/rest/listings/$email"(controller:"listing", parseRequest:true) {
            action = [GET:"listingsForEmailAddress"]
        }
	}


    
}
